home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.net;
-
- import java.io.DataInputStream;
- import java.io.DataOutputStream;
- import java.io.EOFException;
- import java.io.IOException;
- import java.util.Vector;
- import symjava.sql.SQLException;
-
- public class Attribute extends ServerObject {
- String _name;
- int _type;
- int _precision;
- int _scale;
- boolean _isAutoIncrement;
- boolean _isCaseSensitive;
- boolean _isSearchable;
- boolean _isCurrency;
- int _isNullable;
- boolean _isSigned;
- int _columnDisplaySize;
- String _columnLabel;
- String _schemaName;
- String _tableName;
- String _catalogName;
- String _columnTypeName;
- boolean _readOnly;
- boolean _writable;
- boolean _definitelyWritable;
-
- Attribute() {
- }
-
- int getType() {
- return 62;
- }
-
- void read(DataInputStream in) throws SQLException, IOException, ErrorException {
- in.readShort();
-
- try {
- ServerObject obj = (ServerObject)NetClass.getNextObject(in);
- if (obj.getType() != 54) {
- throw new SQLException("Object Stream error in Attribute object");
- } else {
- Vector props = ((ServerList)obj).getObjVector();
- NetData d = (NetData)props.elementAt(0);
- this._isAutoIncrement = d.getBool();
- d = (NetData)props.elementAt(1);
- this._isCaseSensitive = d.getBool();
- d = (NetData)props.elementAt(2);
- this._isSearchable = d.getBool();
- d = (NetData)props.elementAt(3);
- this._isCurrency = d.getBool();
- d = (NetData)props.elementAt(4);
- this._isNullable = d.getShort();
- d = (NetData)props.elementAt(5);
- this._isSigned = d.getBool();
- d = (NetData)props.elementAt(6);
- this._columnDisplaySize = d.getInt();
- NetString s = (NetString)props.elementAt(7);
- this._columnLabel = s.getString();
- s = (NetString)props.elementAt(8);
- this._name = s.getString();
- s = (NetString)props.elementAt(9);
- this._schemaName = s.getString();
- d = (NetData)props.elementAt(10);
- this._precision = d.getInt();
- d = (NetData)props.elementAt(11);
- this._scale = d.getInt();
- s = (NetString)props.elementAt(12);
- this._tableName = s.getString();
- s = (NetString)props.elementAt(13);
- this._catalogName = s.getString();
- d = (NetData)props.elementAt(14);
- this._type = d.getShort();
- s = (NetString)props.elementAt(15);
- this._columnTypeName = s.getString();
- d = (NetData)props.elementAt(16);
- this._readOnly = d.getBool();
- d = (NetData)props.elementAt(17);
- this._writable = d.getBool();
- d = (NetData)props.elementAt(18);
- this._definitelyWritable = d.getBool();
- }
- } catch (EOFException var6) {
- throw new SQLException("Object Stream error in Attribute object");
- }
- }
-
- void write(DataOutputStream out) throws IOException {
- throw new IOException("Write not permitted on Attribute object");
- }
-
- public boolean isAutoIncrement() throws SQLException {
- return this._isAutoIncrement;
- }
-
- public boolean isCaseSensitive() throws SQLException {
- return this._isCaseSensitive;
- }
-
- public boolean isSearchable() throws SQLException {
- return this._isSearchable;
- }
-
- public boolean isCurrency() throws SQLException {
- return this._isCurrency;
- }
-
- public int isNullable() throws SQLException {
- return this._isNullable;
- }
-
- public boolean isSigned() throws SQLException {
- return this._isSigned;
- }
-
- public int getColumnDisplaySize() throws SQLException {
- return this._columnDisplaySize;
- }
-
- public String getColumnLabel() throws SQLException {
- return this._columnLabel;
- }
-
- public String getColumnName() throws SQLException {
- return this._name;
- }
-
- public String getSchemaName() throws SQLException {
- return this._schemaName;
- }
-
- public int getPrecision() throws SQLException {
- return this._precision;
- }
-
- public int getScale() throws SQLException {
- return this._scale;
- }
-
- public String getTableName() throws SQLException {
- return this._tableName;
- }
-
- public String getCatalogName() throws SQLException {
- return this._catalogName;
- }
-
- public int getColumnType() throws SQLException {
- return this._type;
- }
-
- public String getColumnTypeName() throws SQLException {
- return this._columnTypeName;
- }
-
- public boolean isReadOnly() throws SQLException {
- return this._readOnly;
- }
-
- public boolean isWritable() throws SQLException {
- return this._writable;
- }
-
- public boolean isDefinitelyWritable() throws SQLException {
- return this._definitelyWritable;
- }
- }
-